﻿@inherits Vowei.Web.G18nWebViewPage<IEnumerable<Vowei.Data.Models.Statistics.RequirementStatistics>>
@using Vowei.Web.Models;

@{
    ViewBag.Title = T("需求统计信息");
}

<h2>@ViewBag.Title</h2>

<table id="@Vowei.Web.Models.WebConstants.TicketsTableId">
    <tr>
        <th>@T(r => r.First().Requirement)</th>
        @*TODO: 加上下面这一列,在Excel里使用外部数据链接这个功能时,会导致Excel显示乱码 *@
     @*   <th>@T(r => r.First().Requirement.AssignedTo)</th>*@
        <th>
            @T(r => r.First().Level)
        </th>
        <th>
            @T(r => r.First().ActiveTicketsCount)            
        </th>
        <th>
            @T(r => r.First().ClosedTicketsCount)            
        </th>
        <th>
            @T(r => r.First().ActiveTasksCount)            
        </th>
        <th>
            @T(r => r.First().ClosedTasksCount)            
        </th>
        <th>
            @T(r => r.First().CompletedWorkHours)            
        </th>
        <th>
            @T(r => r.First().TotalEstimatedDuration)            
        </th>
        <th>
            @T(r => r.First().EarnedBusinessValue)            
        </th>
        <th>
            @T(r => r.First().TotalBusinessValue)            
        </th>
        <th>
            @T(r => r.First().ActiveRequirementsCount)            
        </th>
        <th>
            @T(r => r.First().ClosedRequirementsCount)            
        </th>
        <th class="row_pk">@T("需求详细信息链接")</th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            <a href="/Requirement/Details/@item.Requirement.ID">@item.Requirement.Title</a>
        </td>
      @*  <td>
            <span>@item.Requirement.AssignedTo</span>
        </td>*@
        <td>
            @item.Level
        </td>
        <td>
            @item.ActiveTicketsCount
        </td>
        <td>
            @item.ClosedTicketsCount
        </td>
        <td>
            @item.ActiveTasksCount
        </td>
        <td>
            @item.ClosedTasksCount
        </td>
        <td>
            @item.CompletedWorkHours.TotalHours
        </td>
        <td>
            @item.TotalEstimatedDuration.TotalHours
        </td>
        <td>
            @item.EarnedBusinessValue
        </td>
        <td>
            @item.TotalBusinessValue
        </td>
        <td>
            @item.ActiveRequirementsCount
        </td>
        <td>
            @item.ClosedRequirementsCount
        </td>
        <td class="row_pk"> 
            @Url.Content(string.Format("http://{0}/Requirement/Details/{1}", Server.MachineName, item.Requirement.ID))
        </td>
    </tr>
}
</table>

<p>
    <a href="/Ticket/ExportToExcel/?title=@Server.UrlEncode(ViewBag.Title)">@T("导出到Excel")</a> |
    <a href="/Statistics/Connect/?id=@ViewData[Vowei.Web.Models.WebConstants.ViewData.Project]&type=@WebConstants.Statistics.RequirementStatistics">@T("使用Excel分析")</a>
</p>

